// 子接口要导入request  发送请求的
import request from '@/utils/request.js'


/**
 * 查询企业的部门列表
 * @param  data 
 */
// 默认导出 getDepartments()
export function getDepartments(){
    return request({
        url:'/company/department',
        method:'get',

        
    })
}

/**
 * 新增部门
 * @param {code,introduce,manager,name,pid} data 
 */
// 默认导出 addDepartments()
export function addDepartments(data){
    return request({
        url:'/company/department',
        method:'post',
        data

        
    })
}

/**
 * 根据ID修改部门详情
 *  @param {code,introduce,manager,name,pid,id} data 
 */
// 默认导出 updataDepartments()
export function updataDepartments(data){
    return request({
        url:`/company/department/${data.id}`,
        method:'put',
        data

        
    })
}
/**
 *   根据ID删除部门
 * @param {id} 
 */
 export function delDepartments(id) {
    return request({
        url:`/company/department/${id}`,
        method:'delete',
        
    })
 
 }
  /**
 * 根据ID查询部门详情
 * @param {id} 
 */
   export function getDepartmentDetail(id) {
    return request({
        url:`/company/department/${id}`,
        method:'get',
     
    })
 
 }